package cn.outmaneuver.outman.web.basic.domain.model;


import java.util.Map;

public class GenericVO {
    private ServiceVO Service;

    public GenericVO() {
    }

    public GenericVO(ServiceVO service) {
        this.Service = service;
    }

    public GenericVO(HeaderVO header){
        this.Service = new ServiceVO();
        this.Service.setHeader(header);
    }

    public GenericVO(Map<String,Object> body){
        this.Service = new ServiceVO();
        this.Service.setBody(body);
    }

    public ServiceVO getService() {
        return Service;
    }

    public void setService(ServiceVO service) {
        Service = service;
    }

    public HeaderVO getHeader(){
        return this.Service.getHeader();
    }

    public void setHeader(HeaderVO header){
        this.Service.setHeader(header);
    }

    public Map<String,Object> getBody(){
        return this.Service.getBody();
    }

    public void setBody(Map<String,Object> body){
        this.Service.setBody(body);
    }

    public static GenericVO success(Map<String,Object> body){
        return new GenericVO(body);
    }

    public static GenericVO fail(String retCode,String retMsg){
        HeaderVO header = new HeaderVO();
        header.setRetCode(retCode);
        header.setRetMsg(retMsg);
        return new GenericVO(header);
    }
}
